package cloud.lysky.java.on.design_pattern.strategy;

/**
 * @author luoly
 * @describe
 * @date 2022-08-20 10:26
 **/
public class LambdaApp {
    public static void main(String[] args) {
        Validator numericValidator = new Validator(s-> s.matches("\\d+"));
        System.out.println(numericValidator.validate("12798724"));
        System.out.println(numericValidator.validate("I'm not a number"));

        Validator lowerCaseValidator = new Validator(s -> s.matches("[a-z]+"));
        System.out.println(lowerCaseValidator.validate("aaabcd"));
        System.out.println(lowerCaseValidator.validate("aaaBcd"));
    }
}